package stream.max;

import java.util.Arrays;
import java.util.List;

public class Test4 {
    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(7, 6, 4, 8, 2, 11, 9);

        long count = list.stream().filter(x -> x > 6).count();
        System.out.println("list中大于6的元素个数："+count);

        list.stream().filter(x -> x > 6).forEach(System.out::println);
    }
}
